package com.nut.article;

import com.nut.article.mapper.ArticleMapper;
import com.nut.article.util.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Slf4j
@EnableTransactionManagement
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
public class ArticleApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext context = SpringApplication.run(ArticleApplication.class, args);

        log.info("ActiveProfile=" + SpringUtil.getActiveProfile());
        Environment environment = context.getBean(Environment.class);
        log.info("http://localhost:" + environment.getProperty("local.server.port"));

//        ArticleMapper bean = context.getBean(ArticleMapper.class);
//        bean.updateSort("hot",1,2);
//        System.out.println("dd");

//        WxMpMessageRouter bean = context.getBean(WxMpMessageRouter.class);
//        System.out.printf(bean.toString());


//                wx5e44c71b25c5e7f3
//                b55729cecfcabc2d26c248117f6b6a68

//        b55729cecfcabc2d26c248117f6b6a68


//        sudo yum install yum-utils
//        sudo rpm --import https://repo.clickhouse.tech/CLICKHOUSE-KEY.GPG
//        sudo yum-config-manager --add-repo https://repo.clickhouse.tech/rpm/clickhouse.repo
//        sudo yum install clickhouse-server clickhouse-client
//
//        sudo /etc/init.d/clickhouse-server start
//        clickhouse-client

    }

}



